<!--
 * @Author: hq
 * @Date: 2022-05-24 14:32:30
 * @LastEditors: hq
 * @LastEditTime: 2022-05-24 14:48:40
 * @Description: your project
 * @version: 1.0
-->
<template>
  <div class="manages">
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="100px"
      class="demo-ruleForm"
    >
      <el-form-item label="管理员账号" prop="name">
        <el-input
          placeholder="请输入管理员账号"
          v-model="ruleForm.username"
        ></el-input>
      </el-form-item>
      <el-form-item label="管理员密码" prop="name">
        <el-input
          placeholder="请输入管理员密码"
          v-model="ruleForm.psw"
        ></el-input>
      </el-form-item>
      <el-form-item label="确认密码" prop="name">
        <el-input
          placeholder="请输入确认密码"
          v-model="ruleForm.confirmPsw"
        ></el-input>
      </el-form-item>
      <el-form-item label="管理员姓名" prop="name">
        <el-input
          placeholder="请输入管理员姓名"
          v-model="ruleForm.name"
        ></el-input>
      </el-form-item>
      <el-form-item label="管理员身份" prop="name">
        <el-input
          placeholder="请输入管理员身份"
          v-model="ruleForm.identify"
        ></el-input>
      </el-form-item>
      <el-form-item label="状态" prop="name">
        <el-switch
          class="tablescope"
          v-model="ruleForm.status"
          :active-color="$color - primary1"
          inactive-color=""
        >
        </el-switch>
      </el-form-item>
    </el-form>
    <div class="btn">
      <el-button type="primary" @click="handleSubmit">确 定</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        username: "",
        state: true,
        psw: "",
        confirmPsw: "",
        name: "",
        identify: "",
      },
      rules: {
        username: [
          { required: true, message: "请输入管理员账号", trigger: "blur" },
        ],
        psw: [{ required: true, message: "请输入管理员密码", trigger: "blur" }],
        confirmPsw: [
          { required: true, message: "请输入确认密码", trigger: "blur" },
        ],
        name: [
          { required: true, message: "请输入管理员姓名", trigger: "blur" },
        ],
        identify: [
          { required: true, message: "请输入管理员身份", trigger: "blur" },
        ],
      },
    };
  },
  methods: {
    handleSubmit() {
      this.$emit("handleClose");
    },
  },
};
</script>

<style lang="scss" scoped>
.manages {
  padding: 0 30px;
  box-sizing: border-box;
  .btn {
    .el-button {
      width: 100%;
    }
  }
}
</style>
